﻿$("#exampleAccordion>li:nth-child(5) a").removeClass("collapsed");
$("#exampleAccordion>li:nth-child(5) ul").addClass("show");
$("#exampleAccordion>li:nth-child(5) ul>li:nth-child(2)").addClass("active");
$(function () {
    var columns = [{ "data": "UserNo" }, { "data": "UserName" }, { "data": "Title" }, { "data": "Name" }, { "data": "EUP" }, { "data": "MUP" }, { "data": "Contre" }, { "data": "AddDT" }, { "data": "MId", render: function (value, type, row) { return '<a href="javascript:void(0)" class="btn btn-success btn-sm" onclick="Reply(0,&apos;' + row.MId + '&apos;)">回复</a><a href="javascript:void(0)" class="btn btn-danger ml-2 btn-sm" onclick="Reply(1,&apos;' + row.MId + '&apos;)">拒绝</a>' } }]
    dataTable.dataTables("/Register/Account", columns, false)
    $("#dataTable_wrapper .row:last-child").addClass("mt-2");
})

function Reply(type,id) {
    if (type == 0) {
        layer.confirm('你是否确认生成账号并回复？', {
            btn: ['确定', '取消'],//按钮
            title: "注册账号"
        }, function () {
            layer.closeAll('dialog');
            $.post("/Register/Index", { mId: id }, function (data) {
                layer.msg(data.Msg)
                setTimeout(function () {
                    location.reload();
                },1500)
            })
        });
    } else {
        layer.prompt({ title: '拒绝信息',formType: 2 }, function (text, index) {
            $.post("/Register/ResultMsg", { id: id, content: text }, function (data) {
                layer.close(index);
                layer.msg(data.Msg);
                setTimeout(function () {
                    location.reload();
                }, 1000)
            })
        });
    }
}